package smedi.ismedi.mobile.bff.controller.videomonitor;

import com.smedi.ismedi.video.monitor.api.dto.request.MultiScreenMonitorRequest;
import com.smedi.ismedi.video.monitor.api.dto.request.VideoControlRequest;
import com.smedi.ismedi.video.monitor.api.dto.response.MultiScreenMonitorResponse;
import com.smedi.ismedi.video.monitor.api.dto.response.RecVideoModelResponse;
import com.smedi.ismedi.video.monitor.api.feign.RemoteMultiScreenMonitorFeignApi;
import com.smedi.ismedi.web.starter.common.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import smedi.ismedi.mobile.bff.controller.BaseController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/mobilebff/v1/video/monitor/multiscreenmonitor")
@AllArgsConstructor
@Api(tags = "多屏监控维护接口")
public class MultiScreenMonitorController extends BaseController {
    private final RemoteMultiScreenMonitorFeignApi remoteMultiScreenMonitorFeignApi;

    /**
     * 实时监控
     *
     * @param multiScreenMonitorRequest
     * @return
     */
    @ApiOperation(httpMethod = "POST", value = "实时监控")
    @PostMapping(value = "/realTimeMonitoring")
    public ResponseData<MultiScreenMonitorResponse> realTimeMonitoring(@Validated @RequestBody MultiScreenMonitorRequest multiScreenMonitorRequest) {
        return remoteMultiScreenMonitorFeignApi.realTimeMonitoring(multiScreenMonitorRequest);
    }

    /**
     * 视屏操作
     *
     * @param videoControlRequest
     */
    @ApiOperation(httpMethod = "POST", value = "视屏操作")
    @PostMapping(value = "/videoControl")
    public ResponseData<String> videoControl(@Validated @RequestBody VideoControlRequest videoControlRequest) {
        return remoteMultiScreenMonitorFeignApi.videoControl(videoControlRequest);
    }

    /**
     * 获取历史影像时间戳
     */
    @ApiOperation(httpMethod = "POST", value = "获取历史影像时间戳")
    @PostMapping(value = "/getVideoTimeLevel")
    ResponseData<List<RecVideoModelResponse>> getVideoTimeLevel(@Validated @RequestBody MultiScreenMonitorRequest multiScreenMonitorRequest) {
        return remoteMultiScreenMonitorFeignApi.getVideoTimeLevel(multiScreenMonitorRequest);
    }

    /**
     * 获取设备抓拍图片
     */
    @ApiOperation(httpMethod = "POST", value = "获取历史影像时间戳")
    @PostMapping(value = "/getVideoDeviceCapture")
    ResponseData<String> getVideoDeviceCapture(@Validated @RequestBody MultiScreenMonitorRequest multiScreenMonitorRequest){
        return remoteMultiScreenMonitorFeignApi.getVideoDeviceCapture(multiScreenMonitorRequest);
    }
}
